/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundless.test;

import boundless.ejb.RequestBean;
import boundless.entities.Account;
import boundless.entities.Joinrequests;
import boundless.entities.League;
import boundless.managedbeans.LeagueBean;
import boundless.managedbeans.LeagueCreationBean;

/**
 *
 * @author hendrikdekock
 */
public class LeagueTester {
    
    
    public static void start(RequestBean rb) {
        LeagueCreationBean lcb = new LeagueCreationBean();
        lcb.setReqBean(rb);
        lcb.setCurUser(rb.getAccountById(79));
        
        LeagueBean lb = new LeagueBean();
        
        
        System.out.println(lcb.createLeague("Testing League", true));
        League sleague = rb.getLeague(35);
        Account hendrik = rb.getAccountById(423);
        
        lb.setCurLeague(sleague);
        lb.setReqBean(rb);
        
        /*System.out.println("REQUEST BEING MADE");
        Joinrequests jr = new Joinrequests(423, 35);
        rb.addJoinRequest(jr);
        
        System.out.println("REQUEST MADE");
        
        lb.acceptJoinRequest(jr);
        
        System.out.println("REQUEST ACCEPTED");
        
        rb.synchronize();*/
        
        lb.togglePermissions();
        
        
        
        
        
    }
}
